package com.netease.pris.activity.view;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import com.netease.framework.k;

public class AttachmentImageView extends ImageView
  implements View.OnClickListener
{
  private Drawable a;
  private Rect b = new Rect();
  private Drawable c;
  private boolean d = false;

  public AttachmentImageView(Context paramContext)
  {
    this(paramContext, null);
  }

  public AttachmentImageView(Context paramContext, AttributeSet paramAttributeSet)
  {
    this(paramContext, paramAttributeSet, 0);
  }

  public AttachmentImageView(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
  {
    super(paramContext, paramAttributeSet, paramInt);
    setScaleType(ImageView.ScaleType.CENTER_CROP);
    this.c = getResources().getDrawable(2130837515);
    this.a = k.a(getContext()).b(2130837513);
    this.a.setCallback(this);
    setPadding(this.a.getIntrinsicWidth() - this.a.getIntrinsicHeight(), 0, 0, 0);
    setOnClickListener(this);
  }

  public void a(int paramInt)
  {
    if (paramInt >= 0)
    {
      this.c = getResources().getDrawable(paramInt);
      this.b.setEmpty();
    }
    while (true)
    {
      return;
      this.c = null;
    }
  }

  public boolean a()
  {
    if (!this.d);
    for (int i = 1; ; i = 0)
      return i;
  }

  protected void drawableStateChanged()
  {
    super.drawableStateChanged();
    if (this.a != null)
    {
      int[] arrayOfInt = getDrawableState();
      this.a.setState(arrayOfInt);
    }
  }

  public void onClick(View paramView)
  {
    if ((paramView != null) && (paramView == this))
      if (this.d)
        break label42;
    label42: for (boolean bool = true; ; bool = false)
    {
      this.d = bool;
      if (!this.d)
        this.b.setEmpty();
      invalidate();
      return;
    }
  }

  protected void onDraw(Canvas paramCanvas)
  {
    super.onDraw(paramCanvas);
    Rect localRect = this.b;
    if (localRect.isEmpty())
    {
      int i = getWidth();
      int j = getHeight();
      localRect.set(0, 0, i, j);
      this.a.setBounds(localRect);
      if ((this.c != null) && (!this.d))
        this.c.setBounds(0, 0, i, j);
    }
    this.a.draw(paramCanvas);
    if ((this.c != null) && (!this.d))
      this.c.draw(paramCanvas);
  }

  protected void onMeasure(int paramInt1, int paramInt2)
  {
    setMeasuredDimension(this.a.getIntrinsicWidth(), this.a.getIntrinsicHeight());
  }

  protected void onSizeChanged(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    super.onSizeChanged(paramInt1, paramInt2, paramInt3, paramInt4);
    this.b.setEmpty();
  }

  protected boolean verifyDrawable(Drawable paramDrawable)
  {
    if ((super.verifyDrawable(paramDrawable)) || (paramDrawable == this.a) || (paramDrawable == this.c));
    for (int i = 1; ; i = 0)
      return i;
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.view.AttachmentImageView
 * JD-Core Version:    0.6.0
 */